import { customAlphabet } from 'nanoid';

import { LayerTypeBE } from '../components/Editor/components/TemplateEffect/constant';

export const titleByLayerType = {
  [LayerTypeBE.Image]: 'Image',
  [LayerTypeBE.Text]: 'Text',
  [LayerTypeBE.Shape]: 'Shape',
  [LayerTypeBE.Product]: 'Product Image'
};

const alphabet = 'abcdefghijklmnopqrstuvwxyz';

export const generateLayerId = (layerType: LayerTypeBE): string => {
  return `layer${layerType}${customAlphabet(alphabet, 20)()}`.toLowerCase();
};
